#include <stdio.h>

int factorial(int x)
{
	/*
	int z,m = 1;
	if(x < 0)
	{
		return 0;
	}
	if(x == 1,0)
	{
		return 1;
	}
	for(z = 1;x >= z;z++)
	{
		m = z * m;
	}
	
	return m;
	*/
	//老师的方法
	int m;
	if(x < 0)
		return 0;
	if(x == 0 || x == 1)
		m = 1;
	if(x > 1)
		m = x * factorial(x - 1);
	return m;
	
}

int main(int argc,char *argv[])
{
	int n;
	scanf("%d",&n);
	int ret = factorial(n);
	printf("%d! = %d\n",n,ret);
	
	return 0;
}